package com.sneakxy.cloudbase.platform.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.TransactionManagementConfigurer;

import com.sneakxy.mybatis.commons.repository.config.EnableMybatisCommonsRepositories;

@Configuration
@EnableTransactionManagement
@EnableMybatisCommonsRepositories(basePackages="com.sneakxy.cloudbase.platform")
public class PersistenceConfig implements TransactionManagementConfigurer {
	
	@Lazy
	@Autowired
	private PlatformTransactionManager transactionManager;
	
	@Override
	public PlatformTransactionManager annotationDrivenTransactionManager() {
		return transactionManager;
	}
	
}
